export default class Login {
    constructor(socket) {
        this.socket = socket;
    }
    sendMessage() {
    }
    /*收到服务器回执信息的处理*/
    receiptMsg(data) {
        console.log("登录成功！", data);
        let res = data.body;
        let { member_id } = res.data.userData;
        this.socket.heart.init(this.socket.so);                                            // 心跳初始化
        this.socket.heart.start(member_id);                                                // 心跳开始
        //controller 属性
        this.socket.receiverController.setMemberId(member_id);                             //设置接受器基本属性
        this.socket.storage.setStorageProperty('property', res.data.userData);
        // this.socket.storage.setProperty(this.socket);
        this.socket.storage.init(this.socket);
        this.socket.loginSuccess(res);
        
        // const msg = this.socket.sendController.pushMessage('getSelfTalkList', {}, this.socket.receiverController.member_id) // 请求用户的好友列表;
        // if (msg.code != 200) {alert("消息创建失败！");return { code: 301, data: '消息创建失败！' }}
        // this.socket.sendController.sendMessage(msg.data.data.head.clientMsgId);
        return res;
    }
    /*接受服务器消息的处理*/
    getMsg(msg) {
        console.log("收到服务器消息，被踢下线！", msg);
        this.socket._logOut();
    }
}